\(\int \frac {1}{(1-x)^{2/3} (1+x+x^2)^{2/3}} \, dx\) [2586]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 45 \[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\frac {x \left (1-x^3\right )^{2/3} \operatorname {Hypergeometric2F1}\left (\frac {1}{3},\frac {2}{3},\frac {4}{3},x^3\right )}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \]

[Out]

x*(-x^3+1)^(2/3)*hypergeom([1/3, 2/3],[4/3],x^3)/(1-x)^(2/3)/(x^2+x+1)^(2/3)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {727, 251} \[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\frac {x \left (1-x^3\right )^{2/3} \operatorname {Hypergeometric2F1}\left (\frac {1}{3},\frac {2}{3},\frac {4}{3},x^3\right )}{(1-x)^{2/3} \left (x^2+x+1\right )^{2/3}} \]

[In]

Int[1/((1 - x)^(2/3)*(1 + x + x^2)^(2/3)),x]

[Out]

(x*(1 - x^3)^(2/3)*Hypergeometric2F1[1/3, 2/3, 4/3, x^3])/((1 - x)^(2/3)*(1 + x + x^2)^(2/3))

Rule 251

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F1[-p, 1/n, 1/n + 1, (-b)*(x^n/a)],
x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p
] || GtQ[a, 0])

Rule 727

Int[((d_.) + (e_.)*(x_))^(m_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[(d + e*x)^FracPart[p]
*((a + b*x + c*x^2)^FracPart[p]/(a*d + c*e*x^3)^FracPart[p]), Int[(d + e*x)^(m - p)*(a*d + c*e*x^3)^p, x], x]
/; FreeQ[{a, b, c, d, e, m, p}, x] && EqQ[b*d + a*e, 0] && EqQ[c*d + b*e, 0] && IGtQ[m - p + 1, 0] &&  !Intege
rQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (1-x^3\right )^{2/3} \int \frac {1}{\left (1-x^3\right )^{2/3}} \, dx}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \\ & = \frac {x \left (1-x^3\right )^{2/3} \, _2F_1\left (\frac {1}{3},\frac {2}{3};\frac {4}{3};x^3\right )}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 10.06 (sec) , antiderivative size = 145, normalized size of antiderivative = 3.22 \[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=-\frac {3 \sqrt [3]{1-x} \left (i+\sqrt {3}+2 i x\right ) \left (\frac {3 i-\sqrt {3}+\left (3 i+\sqrt {3}\right ) x}{3 i+\sqrt {3}-\left (-3 i+\sqrt {3}\right ) x}\right )^{2/3} \operatorname {Hypergeometric2F1}\left (\frac {1}{3},\frac {2}{3},\frac {4}{3},\frac {4 i \sqrt {3} (-1+x)}{\left (-3 i+\sqrt {3}\right ) \left (i+\sqrt {3}+2 i x\right )}\right )}{\left (3 i+\sqrt {3}\right ) \left (1+x+x^2\right )^{2/3}} \]

[In]

Integrate[1/((1 - x)^(2/3)*(1 + x + x^2)^(2/3)),x]

[Out]

(-3*(1 - x)^(1/3)*(I + Sqrt[3] + (2*I)*x)*((3*I - Sqrt[3] + (3*I + Sqrt[3])*x)/(3*I + Sqrt[3] - (-3*I + Sqrt[3
])*x))^(2/3)*Hypergeometric2F1[1/3, 2/3, 4/3, ((4*I)*Sqrt[3]*(-1 + x))/((-3*I + Sqrt[3])*(I + Sqrt[3] + (2*I)*
x))])/((3*I + Sqrt[3])*(1 + x + x^2)^(2/3))

Maple [F]

\[\int \frac {1}{\left (1-x \right )^{\frac {2}{3}} \left (x^{2}+x +1\right )^{\frac {2}{3}}}d x\]

[In]

int(1/(1-x)^(2/3)/(x^2+x+1)^(2/3),x)

[Out]

int(1/(1-x)^(2/3)/(x^2+x+1)^(2/3),x)

Fricas [F]

\[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\int { \frac {1}{{\left (x^{2} + x + 1\right )}^{\frac {2}{3}} {\left (-x + 1\right )}^{\frac {2}{3}}} \,d x } \]

[In]

integrate(1/(1-x)^(2/3)/(x^2+x+1)^(2/3),x, algorithm="fricas")

[Out]

integral(-(x^2 + x + 1)^(1/3)*(-x + 1)^(1/3)/(x^3 - 1), x)

Sympy [F]

\[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\int \frac {1}{\left (1 - x\right )^{\frac {2}{3}} \left (x^{2} + x + 1\right )^{\frac {2}{3}}}\, dx \]

[In]

integrate(1/(1-x)**(2/3)/(x**2+x+1)**(2/3),x)

[Out]

Integral(1/((1 - x)**(2/3)*(x**2 + x + 1)**(2/3)), x)

Maxima [F]

\[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\int { \frac {1}{{\left (x^{2} + x + 1\right )}^{\frac {2}{3}} {\left (-x + 1\right )}^{\frac {2}{3}}} \,d x } \]

[In]

integrate(1/(1-x)^(2/3)/(x^2+x+1)^(2/3),x, algorithm="maxima")

[Out]

integrate(1/((x^2 + x + 1)^(2/3)*(-x + 1)^(2/3)), x)

Giac [F]

\[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\int { \frac {1}{{\left (x^{2} + x + 1\right )}^{\frac {2}{3}} {\left (-x + 1\right )}^{\frac {2}{3}}} \,d x } \]

[In]

integrate(1/(1-x)^(2/3)/(x^2+x+1)^(2/3),x, algorithm="giac")

[Out]

integrate(1/((x^2 + x + 1)^(2/3)*(-x + 1)^(2/3)), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{(1-x)^{2/3} \left (1+x+x^2\right )^{2/3}} \, dx=\int \frac {1}{{\left (1-x\right )}^{2/3}\,{\left (x^2+x+1\right )}^{2/3}} \,d x \]

[In]

int(1/((1 - x)^(2/3)*(x + x^2 + 1)^(2/3)),x)

[Out]

int(1/((1 - x)^(2/3)*(x + x^2 + 1)^(2/3)), x)